package com.bw.mapper;

import com.bw.bean.Vo;
import com.bw.bean.Vo1;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface VoMapper {
    @Select("select ba.name,sum(o.total_amount) value from order_info o\n" +
            "left join base_trademark ba on o.tm_id=ba.id\n" +
            "group by ba.name\n" +
            "order by value asc;")
    List<Vo1> getList2();


    @Select("select bp.name,sum(o.total_amount) value from order_info o\n" +
            "left join base_province bp on bp.id = o.province_id\n" +
            "group by bp.name;")
    List<Vo> getList3();


    @Select("select ba.name,if(ui.gender='F','男','女') value,o.total_amount money from order_info o\n" +
            "left join base_trademark ba on o.tm_id=ba.id\n" +
            "left join user_info ui on ui.id = o.user_id;")
    List<Vo1> getList1();

    @Select("select ui.birthday name,o.total_amount value from order_info o\n" +
            "left join user_info ui on o.user_id = ui.id;")
    List<Vo> getList4();
}
